/*   1:    */ package com.atomikos.beans;
/*   2:    */ 
/*   3:    */ import java.lang.reflect.Constructor;
/*   4:    */ import java.lang.reflect.Field;
/*   5:    */ import java.lang.reflect.Method;
/*   6:    */ import java.util.ArrayList;
/*   7:    */ 
/*   8:    */ public class ClassInspector
/*   9:    */ {
/*  10:    */   private Class clazz_;
/*  11:    */   private MemberFilter memberFilter_;
/*  12:    */   
/*  13:    */   public ClassInspector(Class clazz)
/*  14:    */   {
/*  15: 56 */     this.clazz_ = clazz;
/*  16: 57 */     this.memberFilter_ = new DefaultMemberFilter();
/*  17:    */   }
/*  18:    */   
/*  19:    */   public Class getInspectedClass()
/*  20:    */   {
/*  21: 62 */     return this.clazz_;
/*  22:    */   }
/*  23:    */   
/*  24:    */   public void setMemberFilter(MemberFilter memberFilter)
/*  25:    */   {
/*  26: 67 */     this.memberFilter_ = memberFilter;
/*  27:    */   }
/*  28:    */   
/*  29:    */   public MemberFilter getMemberFilter()
/*  30:    */   {
/*  31: 71 */     return this.memberFilter_;
/*  32:    */   }
/*  33:    */   
/*  34:    */   public Method[] getMethods()
/*  35:    */   {
/*  36: 81 */     Method[] allMethods = this.clazz_.getMethods();
/*  37: 82 */     ArrayList list = new ArrayList();
/*  38: 83 */     for (int i = 0; i < allMethods.length; i++) {
/*  39: 84 */       if (this.memberFilter_.acceptsMethod(allMethods[i])) {
/*  40: 85 */         list.add(allMethods[i]);
/*  41:    */       }
/*  42:    */     }
/*  43: 87 */     Method[] ret = (Method[])list.toArray(new Method[0]);
/*  44:    */     
/*  45: 89 */     return ret;
/*  46:    */   }
/*  47:    */   
/*  48:    */   public Field[] getFields()
/*  49:    */   {
/*  50: 99 */     Field[] allFields = this.clazz_.getFields();
/*  51:100 */     ArrayList list = new ArrayList();
/*  52:101 */     for (int i = 0; i < allFields.length; i++) {
/*  53:102 */       if (this.memberFilter_.acceptsField(allFields[i])) {
/*  54:103 */         list.add(allFields[i]);
/*  55:    */       }
/*  56:    */     }
/*  57:105 */     Field[] ret = (Field[])list.toArray(new Field[0]);
/*  58:    */     
/*  59:107 */     return ret;
/*  60:    */   }
/*  61:    */   
/*  62:    */   public Constructor[] getConstructors()
/*  63:    */   {
/*  64:117 */     Constructor[] allConstructors = this.clazz_.getConstructors();
/*  65:118 */     ArrayList list = new ArrayList();
/*  66:119 */     for (int i = 0; i < allConstructors.length; i++) {
/*  67:120 */       if (this.memberFilter_.acceptsConstructor(allConstructors[i])) {
/*  68:121 */         list.add(allConstructors[i]);
/*  69:    */       }
/*  70:    */     }
/*  71:123 */     Constructor[] ret = (Constructor[])list.toArray(new Constructor[0]);
/*  72:    */     
/*  73:125 */     return ret;
/*  74:    */   }
/*  75:    */ }


/* Location:           C:\myfile\mysoft\apache-maven-3.5.0-bin\apache-maven-3.5.0\myrep\com\atomikos\atomikos-util\3.7.0\atomikos-util-3.7.0.jar
 * Qualified Name:     com.atomikos.beans.ClassInspector
 * JD-Core Version:    0.7.0.1
 */